package streaming

import org.apache.spark.SparkConf
import org.apache.spark.streaming.dstream.{DStream, ReceiverInputDStream}
import org.apache.spark.streaming.{Seconds, StreamingContext}

object SparkStreamingTransform {
  def main(args: Array[String]): Unit = {


    val sparkConf=new SparkConf().setMaster("local[*]").setAppName("sparkStreaming")
    val ssc=new StreamingContext(sparkConf,Seconds(3))
    val lines=ssc.socketTextStream("192.168.80.134",9999)
    /**
     * transform可以将底层RDD获取到后进行操作：
     *
     * */

    ssc.start()
    ssc.awaitTermination()
//    ssc.stop()
    //关闭环境对象
  }

}
